<template>
  <div>
    <svg-icon
      id="guide-full"
      :icon="isFullScreen ? 'exit-fullscreen' : 'fullscreen'"
      @click="onToggle"
    ></svg-icon>
  </div>
</template>

<script setup>
import { onMounted, onUnmounted, ref } from 'vue'
import screenfull from 'screenfull'

const isFullScreen = ref(false)
const change = () => {
  isFullScreen.value = screenfull.isFullscreen
}
const onToggle = () => {
  screenfull.toggle()
}
onMounted(() => {
  screenfull.on('change', change)
})
onUnmounted(() => {
  screenfull.off('change', change)
})
</script>

<style lang="scss" scoped></style>
